#include <bits/stdc++.h>

using namespace std;
#define int long long
const int INF = 0x3f3f3f3f3f3f3f3f;

const int N = 1e6 + 10, M = 1e8 + 10;

int n, L;       // n为物品数量，L为需要的数量
int c[N], l[N]; // 含义见题目
int dp[2][N];
int cnt = 0; // 饮料总量

signed main() {
  memset(dp, 0x3f, sizeof(dp)); // 数组初始化
  cin >> n >> L;
  for (int i = 1; i <= n; i++) {
    cin >> c[i] >> l[i];
    cnt += l[i];
    l[i] = min(l[i], L);
  }
  if (cnt < L) {
    cout << "no solution"; // 无解1
    return 0;
  }
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 2 * L; j >= 0; j--) {
      dp[i&1]=dp[(i-1)&1][j];   
      if(  j>=l[i] )   
        dp[i&1][j] = min(dp[(i-1)&1][j], dp[(i-1)&1][j - l[i]] + c[i]); // 板子
    }
  }
  int ans = INF;
  for (int i = L; i <= 2 * L; i++) {
    ans = min(ans, dp[n&1][i]);
  }
  if (ans == INF) {
    cout << "no solution"; // 无解2
    return 0;
  }
  cout << ans;
  return 0;
}
